-- reduce_cost
-- created by panyl
-- xx消耗-N

return {
    apply = function(prop, baseValue)
        return math.max(baseValue - prop[3], 0);
    end,

    desc = function(prop)
        local str = PropM.query(prop[1], "desc");
        local propName = FieldsM.getFieldName(prop[2]);

        str = string.gsub(str, "{1}", prop[3]);

        return string.gsub(str, "{0}", propName);
    end,

    record = function(target, prop, path)
        return false;
    end
};
